/**
 * 
 */
package kr.co.insoft.driver.rackspace.model;

import kr.co.insoft.driver.model.InstanceModel;

import org.jclouds.compute.domain.NodeMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author IN-SOFT Inc. GoodwillDD(sylee@in-soft.co.kr)
 * 
 */
public class RackSpaceInstanceModel extends InstanceModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6897537879611929525L;

	private static final Logger logger = LoggerFactory
			.getLogger(RackSpaceInstanceModel.class);

	public RackSpaceInstanceModel() {

	}

	/**
	 * @param nodeMetadata
	 */
	public RackSpaceInstanceModel(NodeMetadata nodeMetadata) {
		if (logger.isDebugEnabled()) {
			logger.debug("ComputeMetadata : {}", nodeMetadata);
		}
		setImageId(nodeMetadata.getImageId());
		setInstanceId(nodeMetadata.getId());
		setInstanceName(nodeMetadata.getName());
		setPrivateIpAddress(nodeMetadata.getPrivateAddresses());
		setPublicIpAddress(nodeMetadata.getPublicAddresses());
		setPublicDnsName(nodeMetadata.getHostname());
	}
}
